Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impl. more component-wise built-ins in const. eval. #4879

Merged

Conversation

ErichDonGubler
Copy link
Member

@ErichDonGubler ErichDonGubler commented Dec 14, 2023

Connections

Resolves many numeric built-ins listed under #4507, and sets the groundwork for many more.

Description

Adds support for evaluating the following built-in functions:

  • abs
  • saturate
  • cos
  • cosh
  • sin
  • sinh
  • tan
  • tanh
  • acos
  • acosh
  • asin
  • asinh
  • atan
  • atanh
  • round
  • step
  • sqrt

Testing

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@ErichDonGubler ErichDonGubler added naga Shader Translator kind: refactor Making existing function faster or nicer area: naga processing Passes over IR in the middle labels Dec 14, 2023
@ErichDonGubler ErichDonGubler self-assigned this Dec 14, 2023
@ErichDonGubler ErichDonGubler force-pushed the builtins-const-eval-1 branch 2 times, most recently from 435ed16 to 596bef9 Compare December 14, 2023 15:51
@ErichDonGubler ErichDonGubler force-pushed the builtins-const-eval-1 branch 2 times, most recently from 333cb71 to c7b07d9 Compare December 22, 2023 13:06
@ErichDonGubler ErichDonGubler force-pushed the builtins-const-eval-1 branch 2 times, most recently from 342c881 to 7b7a115 Compare December 22, 2023 14:13
@ErichDonGubler

This comment was marked as resolved.

@ErichDonGubler ErichDonGubler marked this pull request as ready for review December 22, 2023 14:25
@ErichDonGubler ErichDonGubler requested review from a team as code owners December 22, 2023 14:25
Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff! Left some comments about handling edge-cases.

naga/src/proc/constant_evaluator.rs Outdated Show resolved Hide resolved
naga/src/proc/constant_evaluator.rs Outdated Show resolved Hide resolved
naga/src/proc/constant_evaluator.rs Outdated Show resolved Hide resolved
naga/src/proc/constant_evaluator.rs Outdated Show resolved Hide resolved
naga/src/proc/constant_evaluator.rs Outdated Show resolved Hide resolved
naga/src/proc/constant_evaluator.rs Outdated Show resolved Hide resolved
@ErichDonGubler ErichDonGubler force-pushed the builtins-const-eval-1 branch 3 times, most recently from 691f37a to 99c54f4 Compare January 5, 2024 16:48
naga/src/lib.rs Outdated Show resolved Hide resolved
naga/src/proc/constant_evaluator.rs Outdated Show resolved Hide resolved
naga/src/proc/constant_evaluator.rs Outdated Show resolved Hide resolved
@ErichDonGubler ErichDonGubler dismissed jimblandy’s stale review January 18, 2024 21:22

Spoke on call, agreed to merge and iterate.

@ErichDonGubler ErichDonGubler enabled auto-merge (rebase) January 18, 2024 21:24
@ErichDonGubler ErichDonGubler enabled auto-merge (rebase) January 18, 2024 21:39
@ErichDonGubler ErichDonGubler merged commit 063e110 into gfx-rs:trunk Jan 18, 2024
27 checks passed
@ErichDonGubler ErichDonGubler deleted the builtins-const-eval-1 branch January 18, 2024 22:10
@jimblandy
Copy link
Member

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga processing Passes over IR in the middle kind: refactor Making existing function faster or nicer naga Shader Translator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants